#include "accelerometeritem.h"

AccelerometerItem::AccelerometerItem(QQuickItem *parent):
    QQuickItem(parent)
{
    // By default, QQuickItem does not draw anything. If you subclass
    // QQuickItem to create a visual item, you will need to uncomment the
    // following line and re-implement updatePaintNode()

    // setFlag(ItemHasContents, true);
    accel = new Accelerometer(this,"/dev/tty.wchusbserial1420");

    connect(this->accel,SIGNAL(gDataComing(short,short,short)),this,SLOT(getData(short,short,short)));
}

AccelerometerItem::~AccelerometerItem()
{
}

void AccelerometerItem::getData(short x,short y,short z)
{
   // qDebug()<<"AccelerometerItem class x = "<<x << "  y = "<<y << "  z = "<<z;
    emit this->gDataComing(x,y,z);
}
